<?php
namespace app\api\validate;

use think\Validate;

class TodoList extends Validate
{
    protected $rule =   [
        'title' => 'require|max:20',
        'status' => 'require|in:0,1'
    ];
    
    protected $message  =   [
        'title.require' => '代办事项不能为空',
        'title.max' => '内容长度不能超过20个字符',
        'status.in' => '修改参数错误',
        'status.require' => '修改参数不能为空',
    ];

    protected $scene = [
        // 添加待办事务
        'createTodoList' => ['title'],
        //修改代办状态
        'editTodoList' => ['status'],
    ];
    
}